package com.power.flowable.controller;

import com.plf.common.domain.ResponseDTO;
import com.power.flowable.api.SfapproveFlowableFeign;
import com.power.flowable.service.SfapproveFlowableService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
public class SfapproveFlowableController implements SfapproveFlowableFeign {

    @Autowired
    private SfapproveFlowableService service;

    @Override
    public ResponseDTO queryCandidateusers(String bizid, Map<String, List> body) {
        try {
            return ResponseDTO.succData(this.service.queryCandidateusers(bizid, body.get("groupList"), body.get("userList")));
        } catch (Exception e) {
            log.error("查询候选用户失败 queryCandidateusers ->  msg[{}]", e.getMessage());
            return ResponseDTO.wrap(500, "查询候选用户失败");
        }
    }
}
